﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using System.Reflection;

namespace Sio.Mdm.Entities
{
    public class BaseFilter
    {
        protected BaseFilter() { }
        public Object[] _params;
    }

    public class Filter<T> : BaseFilter, ISioFilter<T> 
    {
        private readonly Expression _expression;

        #region constructor
        public Filter()
        {
             _expression = Expression.Constant(this);
        }

        public Filter(params object[] args)
        {
            _expression = Expression.Constant(this);
            _params = args;
        }

        public Filter(Expression expression)
        {
            _expression = expression;
        }
        #endregion

        Expression ISioFilter.Expression
        {
            get { return _expression; }
        }

        ISioFilter<TElement> ISioFilter<T>.CreateQuery<TElement>(Expression expression)
        {
            return new Filter<TElement>(expression);
        }
    }

 
}